package hbt;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

import bean.*;



public class HibernateUtil
{
    private static final SessionFactory sessionFactory;
    static
    {
        try
        {
        	 AnnotationConfiguration config = new AnnotationConfiguration();
        	 config.addAnnotatedClass(AdministracionBean.class);
        	 config.addAnnotatedClass(AdministradorBean.class);
        	 config.addAnnotatedClass(AreaBean.class);
        	 config.addAnnotatedClass(BarraBean.class);
        	 config.addAnnotatedClass(CafeteriaBean.class);
        	 config.addAnnotatedClass(CajaBean.class);
        	 config.addAnnotatedClass(CajeroBean.class);
        	 config.addAnnotatedClass(CartaBean.class);
        	 config.addAnnotatedClass(CocinaBean.class);
        	 config.addAnnotatedClass(CocineroBean.class);
        	 config.addAnnotatedClass(ComandaBean.class);
        	 config.addAnnotatedClass(ComisionBean.class);
        	 config.addAnnotatedClass(CompraNoVentaBean.class);
        	 config.addAnnotatedClass(CompraVentaBean.class);
        	 config.addAnnotatedClass(MozoBean.class);

        	 config.addAnnotatedClass(DepositoBean.class);
        	 config.addAnnotatedClass(DepositoLocalBean.class);
        	 config.addAnnotatedClass(DepositoCentralBean.class);
        	 
        	 config.addAnnotatedClass(EmpleadoBean.class);
        	 config.addAnnotatedClass(FacturaBean.class);
        	 config.addAnnotatedClass(IngredienteBean.class);
        	 config.addAnnotatedClass(IngresoUsuarioBean.class);
        	 config.addAnnotatedClass(ItemFacturaBean.class);
        	 config.addAnnotatedClass(ItemRequerimientoBean.class);
        	 /*
        	  * Agregado por PS
        	  */
        	 config.addAnnotatedClass(ItemOrdenCompraBean.class);
        	 /*
        	  * Agregado por PS
        	  */
        	 config.addAnnotatedClass(ItemDepositoBean.class);
        	 
        	 config.addAnnotatedClass(LocalBean.class);
        	 config.addAnnotatedClass(MedioPagoBean.class);
        	 config.addAnnotatedClass(MesaBean.class);
        	 config.addAnnotatedClass(MovimientoStockBean.class);
        	 config.addAnnotatedClass(MozoBean.class);
        	 config.addAnnotatedClass(CocineroBean.class);
        	 config.addAnnotatedClass(OrdenCompraBean.class);
        	 config.addAnnotatedClass(PedidoBean.class);
        	 config.addAnnotatedClass(PlanProduccionEstrategiaBean.class);
        	 config.addAnnotatedClass(PlatoBean.class);
        	 config.addAnnotatedClass(ProductoBean.class);
        	 config.addAnnotatedClass(ProveedorBean.class);
        	 config.addAnnotatedClass(RecetaBean.class);
        	 config.addAnnotatedClass(RequerimientoStockBean.class);
        	 config.addAnnotatedClass(SalonBean.class);
        	 config.addAnnotatedClass(SectorBean.class);
        	 config.addAnnotatedClass(UnidadBean.class);
        	 
             sessionFactory = config.buildSessionFactory();
        }
        catch (Throwable ex)
        {
            System.err.println("Initial SessionFactory creation failed." + ex);
            throw new ExceptionInInitializerError(ex);
        }
    }
 
    public static SessionFactory getSessionFactory()
    {
        return sessionFactory;
    }
}
